#ifndef motors_h
#define motors_h

/************************************************************************************************* 

	Name: MOTORS_H
	Autor: JA&AP
	
	Contains: 
				Header File containing all the functions related to the Motors.
				
				
**************************************************************************************************/

#include "structures.h"
#include "structures.h"
#include "pwm.h"
#include "encoders.h"

//#define ENC_CONV 1
//#define CORR	3000/CONTROL_INTERVAL
//#define TICSxROTATION 362 
#define WHEEL_RADIUS 33 // radius wheel in mm
#define PI 3.14159
#define DIR_RIGHT 4
#define DIR_LEFT 3
#define MOTOR_RIGHT 1
#define MOTOR_LEFT 0
#define MAX_VEL 100
//relationship between sample frequency and velocity
#define VEL_FACT 1111
//! Get the actual velocity of right wheel in tics/seg
/*!
 * \param dt interval sample
 * Returns velocity in tics/seg
 */


void motors_getActualVels(velocities *vels, unsigned int sampleFreq);
/*************************************************************************
Routine: 	CONFIGMOTORS
Purpose:  	Configures the Motor Hardware.
In:			float time for the update interval.
Out:		void
**************************************************************************/
void motors_init(unsigned char freq);


/*************************************************************************
Routine: 	SETVELMOTOR
Purpose:  	Sets the Motors velocity in m/s.
In:			float left vel, float right vel .
Out:		void
**************************************************************************/
void motors_setVel(int vel,unsigned char motor);

#endif
